Repository navigation
fix(render): don't pre-create file bind-mount sources as directories - #680
Merged
Merged
Conversation
render-config.sh pre-creates every gitignored compose bind-mount source
so Docker doesn't make it root-owned. That block assumed every such
source is a directory. The soc stack is the first to bind-mount
individual gitignored FILES — wazuh/certs/*.pem (written by the certs
generator) and .rendered/internal_users.yml, .rendered/authd.pass
(written by render itself moments later). The loop mkdir'd those paths
as directories, and render then failed writing internal_users.yml over
the directory it had just created ("Is a directory").
Skip a gitignored source whose basename carries a filename extension
(`?*.*` — a dot that isn't the first character, so `.rendered` dotdirs
are still created); it's a file its producer writes before `make up`,
not a directory to pre-create.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
render-config.shpre-creates every gitignored compose bind-mount source so Docker won't create it root-owned atuptime. That block assumed every gitignored source is a directory.The soc stack is the first to bind-mount individual gitignored files:
wazuh/certs/*.pem— written by thewazuh.certs-generatorprofilewazuh/indexer/.rendered/internal_users.yml,wazuh/manager/.rendered/authd.pass— written by render itself, moments later in the same runThe loop
mkdir -p'd those paths as directories. Render then failed writinginternal_users.ymlover the directory it had just made:This surfaced building
odin(#266/#267):make render STACK=soccould not complete.The fix
Skip a gitignored source whose basename carries a filename extension —
?*.*, "a dot that is not the first character", so a.rendereddotdir is still pre-created, whileauthd.pass,admin.pem,internal_users.ymlare left to their producers. Files a producer writes beforemake updon't need pre-creating; only directories do.No behaviour change for the observability/lab/sensitive stacks (their runtime sources are directories). shellcheck-clean.
🤖 Generated with Claude Code